import instance from '@/utils/axios'
import { getToken } from '@/utils/token.js'
function getLogin({ mobile, code }) {
    return instance({
        url: '/v1_0/authorizations',
        method: 'post',
        data: {
            mobile,
            code
        }
    })
}
export { getLogin }
function getUserInfo() {
    return instance({
        url: '/v1_0/user/profile',
        method: 'get',
        // headers: { Authorization: `Bearer ${getToken().token}` }
    })
}
export { getUserInfo }

function editUserInfo(obj) {
    return instance({
        url: '/v1_0/user/profile',
        method: 'patch',
        data: obj,
        headers: { Authorization: `Bearer ${getToken().token}` }
    })
}
export { editUserInfo }

function editPhoto(fd) {
    return instance({
        url: '/v1_0/user/photo',
        method: 'patch',
        data: fd,
        headers: { Authorization: `Bearer ${getToken().token}` }
    })
}
export { editPhoto }